package com.itheima.listener;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class ContextLoaderListener implements ServletContextListener {
    public void contextDestroyed(ServletContextEvent sce) {
        ApplicationContext app=new ClassPathXmlApplicationContext("applicationContext.xml");
        sce.getServletContext().setAttribute("app",app);
    }
}
